package com.huiyeji.hui.exception;

import com.huiyeji.hui.utils.ErrorEnum;

/**
 * @author zhaoduo
 */
public class HuiException extends RuntimeException{

    private final Integer code;

    public HuiException(){
        super();
        this.code = ErrorEnum.DEFAULT.getCode();
    }

    public HuiException(ErrorEnum errorEnum){
        super(errorEnum.getMsg());
        this.code = errorEnum.getCode();
    }

    public HuiException(String msg){
        super(msg);
        this.code = ErrorEnum.DEFAULT.getCode();
    }

    public HuiException(ErrorEnum errorEnum,String msg){
        super(msg);
        this.code = errorEnum.getCode();
    }

    public Integer getCode() {
        return code;
    }
}
